from django.conf.urls import url
from .views import viewsIndex,viewsUsers,viewsCates,viewsGoods,viewsOrder

urlpatterns = [
    # 首页
    url(r'^$', viewsIndex.admin_index, name='myadmin_index'),
    url(r'^login/$', viewsIndex.myadminlogin,name='myadmin_login'),
    url(r'^verifycode/$', viewsIndex.verifycode,name='myadmin_verifycode'),
    url(r'^logout/$', viewsIndex.myadminlogout,name='myadmin_logout'),
    
    # 会员添加
    url(r'^user/add/$', viewsUsers.useradd, name='myadmin_user_add'),
    url(r'^user/index/$', viewsUsers.userindex, name='myadmin_user_index'),
    url(r'^user/del/(?P<uid>[0-9]+)/$', viewsUsers.userdel, name="myadmin_user_del"),
    url(r'^user/edit/(?P<uid>[0-9]+)/$', viewsUsers.useredit, name="myadmin_user_edit"),

    # 商品分类管理
    url(r'^cates/add/$', viewsCates.catesadd, name='myadmin_cates_add'),
    url(r'^cates/index/$', viewsCates.catesindex, name='myadmin_cates_index'),
    url(r'^cates/del/$', viewsCates.catesdel, name='myadmin_cates_del'),
    url(r'^cates/edit/$', viewsCates.catesedit, name='myadmin_cates_edit'),

    # 商品管理
    url(r'^goods/add/$', viewsGoods.goodsadd, name='myadmin_goods_add'),
    url(r'^goods/insert/$', viewsGoods.goodsinsert, name='myadmin_goods_insert'),
    url(r'^goods/index/$', viewsGoods.goodsindex, name='myadmin_goods_index'),
    url(r'^goods/del/(?P<gid>[0-9]+)/$', viewsGoods.goodsdel, name='myadmin_goods_del'),
    url(r'^goods/edit/$', viewsGoods.goodsedit, name='myadmin_goods_edit'),

    # 订单管理
    url(r'^order/index/$', viewsOrder.orderindex, name='myadmin_order_index'),
    url(r'^order/edit/$', viewsOrder.orderedit, name='myadmin_order_edit'),
    url(r'^/order/del$', viewsOrder.orderdel, name='myadmin_order_del'),
]